<?php $this->JQuery()->enable();?>

<script type="text/javascript">
$(function(){
	 
    // add multiple select / deselect functionality
    $("#selectall").click(function () {
          $('.case').attr('checked', this.checked);
    });
 
    // if all checkbox are selected, check the selectall checkbox
    // and viceversa
    $(".case").click(function(){
 
        if($(".case").length == $(".case:checked").length) {
            $("#selectall").attr("checked", "checked");
        } else {
            $("#selectall").removeAttr("checked");
        }
 
    });
});
</script>
<!--  start table-content  -->
			<div id="table-content">
<!--  start product-table ..................................................................................... -->
				<form id="mainform" action="" method="post">
				<table border="0" width="100%" cellpadding="0" cellspacing="0" id="product-table">
				<tr>
					<th class="table-header-check"><input type="checkbox" id="selectall"/></th>
					<th class="table-header-repeat line-left"><a>Tên Mã</a></th>
					<th class="table-header-repeat line-left minwidth-1"><a>Tên khóa học</a></th>
					<th class="table-header-repeat line-left minwidth-1"><a>Tên lớp</a></th>
					<th class="table-header-repeat line-left"><a>Ngày khai giảng</a></th>
					<th class="table-header-repeat line-left minwidth-1"><a>Giáo viên giảng dạy</a></th>
					<th class="table-header-repeat line-left"><a>Trạng thái</a></th>
					<th class="table-header-options line-left"><a href="">Cập nhật</a></th>
				</tr>
				
				
<?php
	foreach($this->dkkh as $khoahoc)
	{
		$idkhoahoc = $khoahoc->getId();
		$id = $khoahoc->getMakhoahoc();
		$tenkhoahoc = $khoahoc->getTenkhoahoc();
		$lophoc = $khoahoc->getLophoc();
		$tenlop = $lophoc->getTenlop();
		$ngaykhaigiang = $khoahoc->getDate();
		$giaovien = $khoahoc->getGiaovien();
		$tengiaovien = $giaovien->getTengiaovien();
		$trangthai = $khoahoc->getTrangthaikhoahoc();;
		$linkEdit = $this->baseUrl('/admin/khoahoc/capnhat/id/'. $idkhoahoc);
		$linkDelete = $this->baseUrl('/admin/khoahoc/xoa/id/'. $idkhoahoc);
		$linkDanhsach = $this->baseUrl('/admin/khoahoc/danhsach/id/'. $idkhoahoc);
?>
	<tr>
					<td><?php echo $this->formCheckbox('case'.$idkhoahoc,'1',array('class'=>'case'))?></td>
					<td><?php echo $id?></td>
					<td><?php echo $tenkhoahoc?></td>
					<td><?php echo $tenlop?></td>
					<td><?php echo $ngaykhaigiang?></td>
					<td><?php echo $tengiaovien?></td>
					<td><?php echo $trangthai?></td>
					<td class="options-width">
					<a href="<?php echo $linkEdit?>" title="Cập nhật" class="icon-1 info-tooltip"></a>
					<a href="<?php echo $linkDelete?>" title="Xóa" class="icon-2 info-tooltip"></a>
					<a href="<?php echo $linkDanhsach?>" title="Danh sách đăng ký">Danh sách đăng ký</a>
					</td>
				</tr>
<?php
			
	} 
?>
			</table>
			<?php echo $this->formSubmit('submit','Xóa chọn')?>
				<!--  end product-table................................... -->
				</form>
				</div>
			<!--  end content-table  -->
